package ace.module.oauth2.server.core.impl.listener;

import ace.module.oauth2.server.core.impl.service.Oauth2ServerInitService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
* module init event listener.
*
* @author Caspar
*/
@Slf4j
@RequiredArgsConstructor
@Component
public class Oauth2ServerInitListener implements ApplicationListener<ApplicationStartedEvent> {

  private final Oauth2ServerInitService OAuth2ServerInitService;

  @Override
  public void onApplicationEvent(ApplicationStartedEvent event) {
    OAuth2ServerInitService.init();
  }
}
